In a network application, in order to communicate with networks indifferent network segments, a host needs to set a default gateway, and only via the default gateway can all packets of a network segment be forwarded to other network segments. When the gateway has a failure, communications between the whole host and external networks are interrupted. In a virtual router redundancy protocol (Virtual Router Redundancy Protocol, VRRP for short), the backup of a next-hop gateway can be implemented only by configuring a very few pieces of commands on a related router instead of changing a networking condition or performing any configuration on the host, and further no burden is brought to the host. Compared with the other methods, the VRRP has advantages, such as simple configuration, convenient management, and no need of extra supporting added to the host.
In an application process of the VRRP, a master (master) router is selected from a plurality of routers via a priority. Only the master router can send a VRRP packet, and the other backup (backup) routers are prohibited from sending a VRRP packet. When receiving a VRRP packet with a higher priority than that of the master router, the master router changes from a master state to a backup state, no longer sends the VRRP packet, and discards all datagrams with destination media access control (Media Access Control, MAC for short) addresses being virtual router MAC addresses. The VRRP only needs to be run on a router, and when a host is converged to the router by an access device, the access device sends a VRRP packet from an inbound port connected to the router as an ordinary service packet to an outbound port connected to the host, where the inbound port and the outbound port are not limited and the VRRP packet can be received by a user accessing the Internet.
In the prior art, in a downlink forwarding direction of the access device, as the destination MAC address of the VRRP packet is a multicast address, the access device directly forwards, in a multicast manner, the VRRP packet from the inbound port connected to the router as the ordinary service packet to the outbound port connected to the host and to each user accessing the Internet on the user side, that is, the host. After receiving the VRRP packet, the user accessing the Internet can modify the priority of the VRRP packet to be the highest, and then send the VRRP packet to the network side. Moreover, the VRRP packet, whose priority is modified by the user accessing the Internet, can enable the actual master router to be changed from the master state to the backup state and no longer to forward a service packet, so that services of users accessing the Internet under the whole virtual router are interrupted, thereby affecting the network security.